package org.example.flinksql.test.custom;

import org.apache.flink.table.functions.ScalarFunction;

public class TransStockTypeFunc extends ScalarFunction {

    public Integer eval(String str) {
        if (null == str) {
            return null;
        }
        Integer code = null;
        switch (str) {
            case "合伙企业":
                code = 0;
                break;
            case "企业法人":
                code = 1;
                break;
            case "自然人股东":
                code = 2;
                break;
        }

        return code;
    }
}
